MODELE EPIDEMIOLOGICZNE
using Plots
using DataFrames
using Statistics
using CSV
function SIS_model(
population,
infected,
ÎČ, # transmission coefficient
Îł, # recovery rate
T # time
)
S = zeros(T, 1) # Susceptible
I = zeros(T, 1) # Infectious
S[1] = population - infected
I[1] = infected
N = population
for t in 1:T-1
S[t+1] = S[t] - (ÎČ * I[t] * S[t] / N) + (Îł * I[t])
I[t+1] = I[t] + (ÎČ * I[t] * S[t] / N) - (Îł * I[t])
end
plot(1:T, S, label="S", xlabel="Time", ylabel="Population", title="ÎČ = $ÎČ")
plt = plot!(1:T, I, label="I", color=:red)
return plt
end
SIS_model (generic function with 1 method)
population = 10000
infected = 10
ÎČ = 0.2 # transmission coefficient
Îł = 0.05 # recovery rate
T = 100 # time
SIS_model(population, infected, ÎČ, Îł, T)
range = 0.6:-0.01:0.05
population = 10000
infected = 30
Îł = 0.1 # recovery rate
T = 300 # time
anim = @animate for parameter in range
SIS_model(population, infected, parameter, Îł, T)
end
gif(anim, "SIS.gif", fps= 15)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\SIS.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
Model ten opisuje osoby podatne-zakaĆŒone-ozdrowiaĆe.
Warunki poczÄ tkowe:
function SIR_model(
population,
infected,
ÎČ, # transmission coefficient
Îł, # recovery rate
T # time
)
S = zeros(T, 1) # Susceptible
I = zeros(T, 1) # Infectious
R = zeros(T, 1) # Recvered
S[1] = population - infected
I[1] = infected
for t in 1:T-1
N = population
S[t+1] = S[t] - S[t] * I[t] * ÎČ / N
I[t+1] = I[t] - I[t] * Îł + S[t] * I[t] * ÎČ / N
R[t+1] = R[t] + I[t] * Îł
end
plot(1:T, S, label="Susceptible", title = "The SIR model \nÎČ = $ÎČ",xlabel="Time", ylabel="Population")
plot!(1:T, I, label="Infected")
plot!(1:T, R, label="Removed")
end
SIR_model (generic function with 1 method)
population = 10000
infected = 30
ÎČ = 0.2 # transmission coefficient
Îł = 0.05 # recovery rate
T = 130 # time
SIR_model(population, infected, ÎČ, Îł, T)
range = LinRange(1, 0.1, 101)
anim = @animate for param in range
SIR_model(population, infected, round(param, digits=3), Îł, T)
end
gif(anim, "SIR.gif", fps= 10)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\SIR.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
$\beta$ - wspĂłĆczynnik zainfekowania
$\delta$ - ĆmiertelnoĆÄ w wyniku infekcji
$\gamma$ - tempo zdrowienia
populacja wraz ze zmarĆymi $ N = S + I + R + D $ jest staĆa
Model ten opisuje osoby podatne-zakaĆŒone-ozdrowiaĆe-zmarĆe
Nowy element : D - osoby zmarĆe.
function SIRD_model(
population,
infected,
ÎČ, # transmission coefficient
ÎŽ, # infection mortality
Îł, # recovery rate
T # time
)
S = zeros(T, 1) # Susceptible
I = zeros(T, 1) # Infectious
R = zeros(T, 1) # Recovered
D = zeros(T, 1) # Deceased
S[1] = population - infected
I[1] = infected
for t in 1:T-1
N = population
S[t+1] = S[t] - S[t] * I[t] * ÎČ / N
I[t+1] = I[t] * (1 - ÎŽ - Îł) + S[t] * I[t] * ÎČ / N
R[t+1] = R[t] + Îł * I[t]
D[t+1] = D[t] + ÎŽ * I[t]
end
deaths = Int(floor(D[T]))
plot(1:T, S, label="Susceptible", title = "Deaths from infection: $deaths\nÎČ = $ÎČ", xlabel="Time", ylabel="Population")
plot!(1:T, I, label="Infected")
plot!(1:T, R, label="Recovered")
plt = plot!(1:T, D, label="Deceased")
return plt
end
SIRD_model (generic function with 1 method)
population = 10000
infected = 30
ÎČ = 0.2 # transmission coefficient
ÎŽ = 0.005 # infection mortality
Îł = 0.05 # recovery rate
T = 200 # time
SIRD_model(population, infected, ÎČ, ÎŽ, Îł, T)
range = LinRange(1, 0.1, 101)
anim = @animate for param in range
SIRD_model(10000, 30, round(param, digits=3), 0.005, 0.05, 130)
end
gif(anim, "SIRD.gif", fps= 15)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\SIRD.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
function SEIR_model(
population,
infected,
ÎČ, # transmission coefficient
a, # incubation rate
Îł, # recovery rate
T # time
)
S = zeros(T, 1) # Susceptible
E = zeros(T, 1) # Exposed
I = zeros(T, 1) # Infectious
R = zeros(T, 1) # Recovered
S[1] = population - infected
I[1] = infected
for t in 1:T-1
N = population
S[t+1] = S[t] - S[t] * I[t] * ÎČ / N
E[t+1] = E[t] * (1 - a) + S[t] * I[t] * ÎČ / N
I[t+1] = I[t] * (1 - Îł) + E[t] * a
R[t+1] = R[t] + I[t] * Îł
end
plot(1:T, S, label="Susceptible", title = "ÎČ = $ÎČ", xlabel="Time", ylabel="Population")
plot!(1:T, E, label="Exposed", color=:orange)
plot!(1:T, I, label="Infected", color=:red)
plt = plot!(1:T, R, label="Recovered", color=:green)
return plt
end
SEIR_model (generic function with 1 method)
population = 10000
infected = 30
ÎČ = 0.2 # transmission coefficient
a = 0.25 # incubation rate
Îł = 0.05 # recovery rate
T = 365 # time
SEIR_model(population, infected, ÎČ, a, Îł, T)
(process:14456): GLib-GIO-WARNING **: 22:45:55.526: Unexpectedly, UWP app `NightRise.NotepadWrapped_7.59.32.0_x64__bahp16nyyek9m' (AUMId `NightRise.NotepadWrapped_bahp16nyyek9m!NotepadWrapped') supports 89 extensions but has no verbs (process:14456): GLib-GIO-WARNING **: 22:45:56.710: Unexpectedly, UWP app `Microsoft.ZuneVideo_10.21021.10311.0_x64__8wekyb3d8bbwe' (AUMId `Microsoft.ZuneVideo_8wekyb3d8bbwe!Microsoft.ZuneVideo') supports 33 extensions but has no verbs
range = 0.8:-0.01:0.1
anim = @animate for parameter in range
SEIR_model(population, infected, parameter, a, Îł, T)
end
gif(anim, "SEIR.gif", fps= 10)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\SEIR.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\FKcum\src\animation.jl:104
SEIRD, SEIRS, MSEIR, MSEIRS
$\beta$ - wspĂłĆczynnik zainfekowania
a - tempo rozwoju infekcji
$\delta$ - ĆmiertelnoĆÄ w wyniku infekcji
$\gamma$ - tempo zdrowienia
p - tempo tracenia odpornoĆci
function SEIRSD_model(
population,
infected,
ÎČ, # transmission coefficient
a, # incubation rate
ÎŽ, # infection mortality
Îł, # recovery rate
p, # loosing immunity rate
T, # time
mode # return plot ("plot") or deaths ("deaths")
)
S = zeros(T, 1) # Susceptible
E = zeros(T, 1) # Exposed
I = zeros(T, 1) # Infectious
R = zeros(T, 1) # Recovered
D = zeros(T, 1) # Deceased
S[1] = population - infected
I[1] = infected
for t in 1:T-1
N = population
S[t+1] = S[t] - S[t] * I[t] * ÎČ / N + R[t] * p
E[t+1] = E[t] * (1 - a) + S[t] * I[t] * ÎČ / N
I[t+1] = I[t] * (1 - ÎŽ - Îł) + E[t] * a
R[t+1] = R[t] * (1 - p) + I[t] * Îł
D[t+1] = D[t] + ÎŽ * I[t]
end
deaths = Int(floor(D[T]))
plot(1:T, S, label="S", title = "Deaths from infection: $deaths\nÎČ = $ÎČ", xlabel="Time", ylabel="Population")
plot!(1:T, E, label="E", color=:orange)
plot!(1:T, I, label="I", color=:red)
plot!(1:T, R, label="R", color=:green)
plt = plot!(1:T, D, label="D", color=:black)
if mode == "plot"
return plt
elseif mode == "deaths"
return deaths
end
end
SEIRSD_model (generic function with 1 method)
population = 10000
infected = 100
ÎČ = 0.2 # transmission coefficient
a = 0.1 # incubation rate
ÎŽ = 0.001 # infection mortality
Îł = 0.05 # recovery rate
p = 0.01 # loosing immunity rate
T = 500 # time
SEIRSD_model(population, infected, ÎČ, a, ÎŽ, Îł, p, T, "plot")
(process:12888): GLib-GIO-WARNING **: 23:11:47.168: Unexpectedly, UWP app `NightRise.NotepadWrapped_7.59.32.0_x64__bahp16nyyek9m' (AUMId `NightRise.NotepadWrapped_bahp16nyyek9m!NotepadWrapped') supports 89 extensions but has no verbs (process:12888): GLib-GIO-WARNING **: 23:11:47.833: Unexpectedly, UWP app `Microsoft.ZuneVideo_10.21021.10311.0_x64__8wekyb3d8bbwe' (AUMId `Microsoft.ZuneVideo_8wekyb3d8bbwe!Microsoft.ZuneVideo') supports 33 extensions but has no verbs
range = 0.9:-0.01:0.05
population = 10000
infected = 100
a = 0.25 # incubation rate
ÎŽ = 0.001 # infection mortality
Îł = 0.05 # recovery rate
p = 0.01 # loosing immunity rate
T = 500 # time
anim = @animate for parameter in range
SEIRSD_model(population, infected, parameter, a, ÎŽ, Îł, p, T, "plot")
end
gif(anim, "SEIRSD.gif", fps= 15)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\SEIRSD.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\FKcum\src\animation.jl:104
population = 10000
infected = 100
ÎČ = 0.2 # transmission coefficient
a = 0.25 # incubation rate
ÎŽ = 0.001 # infection mortality
Îł = 0.05 # recovery rate
p = 0.01 # loosing immunity rate
T = 500 # time
println(" ÎČ | deaths")
println("----|-------")
for ÎČ in 0.1:0.1:1
deaths = SEIRSD_model(population, infected, ÎČ, a, ÎŽ, Îł, p, T, "deaths")
println(ÎČ, " | ", deaths)
end
ÎČ | deaths ----|------- 0.1 | 388 0.2 | 624 0.3 | 705 0.4 | 746 0.5 | 771 0.6 | 788 0.7 | 800 0.8 | 810 0.9 | 817 1.0 | 822
"Simulate the epidemic using given parameteres.
Display the plot of infected number and the animation of epidemic progress.
Return a vector containing total deaths and maximum infected with symptoms number."
function area_epidemic_simulation(
size, # side of an array representing population
N0, # first infected
meetings, # number of meetings per day for one person
incubation_time, # virus incubation time
immunity_time, # immunity time after recovery
lockdowns, # periods of time with lockdown
vaccination_day, # day when vaccination begins
vaccinations, # percent of population vaccinated per day
vaccine_immunity_time, # vaccine immunity time
death_prob, # death from infection
recovery_prob, # probability of recovery after infection
infection_probability, # probability of infection
symptoms_prob, # probability of having symptoms after infection
move_probability, # probability o moving for one person
T, # time
display_heatmap=true,
display_plot=true)
# 0 - dead
# 1 - susceptible
# 2 - exposed
# 3 - infected
# 4 - recovered
# Conteners for each state
dead = []
susceptible = collect(1:size^2)
exposed = []
infected = []
infected_asymptomatic = []
recovered = []
vaccinated = []
unvaccinated = collect(1:size^2)
# Records
total_infected_record = [N0]
infected_record = [0]
dead_record = [0]
population = ones(size, size) # Array with each person's state
infection_days = fill(T, size, size) # Array with days of infection
recovery_days = fill(T, size, size) # Array with days of recovery
vaccination_days = fill(T, size, size) # Array with days of vaccination
vaccinations = floor(vaccinations * size^2) # Number of vaccinations in one day
# Random first infected
for person in 1:N0
index = rand(susceptible)
population[index] = 3
append!(infected_asymptomatic, index)
filter!(i -> i != index, susceptible)
end
# For each day in T days
anim = @animate for t in 1:T
infection_prob = infection_probability
met_today = meetings
move_prob = move_probability
# If it's lockdown, reduce infection probability, meetings and moving probability
for lockdown in lockdowns
if lockdown[1] <= t <= lockdown[2]
if lockdown[3] == 1 # Light lockdown
infection_prob = 0.7 * infection_prob
met_today = 2
move_prob = 0.7 * move_prob
elseif lockdown[3] == 2 # Heavy lockdown
infection_prob = 0.5 * infection_prob
met_today = 1
move_prob = 0.5 * move_prob
end
end
end
# Vaccination
if t >= vaccination_day
possible_to_vaccinate = filter(i -> i â infected, unvaccinated)
for person in 1:vaccinations
try
index = rand(possible_to_vaccinate)
append!(vaccinated, index)
filter!(i -> i != index, unvaccinated)
filter!(i -> i != index, possible_to_vaccinate)
vaccination_days[index] = t
catch ArgumentError
continue
end
end
end
# For each person
for row in 1:size
for person in 1:size
index = size*(person-1) + row
# If vaccine immunity time has ended
if t - vaccination_days[index] >= vaccine_immunity_time
append!(unvaccinated, index)
filter!(i -> i != index, vaccinated)
end
# If person is exposed and incubation time has ended, change her status to infected
if population[index] == 2 && t - infection_days[index] >= incubation_time
population[index] = 3
if index â vaccinated # If person is vaccinated, reduce symptoms probability
if rand()<symptoms_prob/5
append!(infected, index)
else
append!(infected_asymptomatic, index)
end
elseif rand()<symptoms_prob
append!(infected, index)
else
append!(infected_asymptomatic, index)
end
filter!(i -> i != index, exposed)
end
# If person is healthy and travels
if index â vcat(infected_asymptomatic, infected, dead) && rand()<move_prob
inf_prob = infection_prob
random_person = rand(1:size^2) # Random met person
if random_person â infected_asymptomatic # If met person is infected asymptopmatic
# If travelling person is vaccinated, reduce infection probability
if index â vaccinated
inf_prob = inf_prob/6
end
# If travelling person is susceptible
if population[index] == 1 && rand()<inf_prob
population[index] = 2
append!(exposed, index)
filter!(i -> i != index, susceptible)
infection_days[index] = t
# If travelling person is recovered
elseif population[index] == 4
time_from_recovery = t - recovery_days[index]
full_immunity_time = floor(0.3 * immunity_time)
inf_prob = inf_prob * (time_from_recovery - full_immunity_time) / (immunity_time - full_immunity_time)
if time_from_recovery >= full_immunity_time && rand()<inf_prob
population[index] = 2
append!(exposed, index)
filter!(i -> i != index, recovered)
infection_days[index] = t
end
end
end
end
# If the person is infected
if population[row, person] == 3
# If person is infected asymptomatic, he can travel or stay home
if index â infected_asymptomatic
# If infected person travels
if rand()<move_prob
inf_prob = infection_prob
random_person = rand(1:size^2) # Random met person
# If met person is vaccinated reduce infection probability
if random_person â vaccinated
inf_prob = inf_prob/6
end
# If met person is susceptible
if population[random_person] == 1 && rand()<inf_prob
population[random_person] = 2
append!(exposed, random_person)
filter!(i -> i != random_person, susceptible)
infection_days[random_person] = t
# If met person is recovered
elseif population[random_person] == 4
time_from_recovery = t - recovery_days[random_person]
full_immunity_time = floor(0.3 * immunity_time)
inf_prob = inf_prob * (time_from_recovery - full_immunity_time) / (immunity_time - full_immunity_time)
if time_from_recovery >= full_immunity_time && rand()<inf_prob
population[random_person] = 2
append!(exposed, random_person)
filter!(i -> i != random_person, recovered)
infection_days[random_person] = t
end
end
# If person stays home
else
# For each met person from the neighbourhood
for met_person in 1:met_today
inf_prob = infection_prob
m = rand(-1:1)
n = rand(-1:1)
# If we go out of range
if row + m > size || row + m < 1 || person + n > size || person + n < 1
continue
end
neighbour = size * (person + n - 1) + row + m
# If met neighbour is vaccinated, reduce infection probability
if neighbour â vaccinated
inf_prob = inf_prob/6
end
# If neighbour is susceptible
if population[row + m, person + n] == 1 && rand()<inf_prob
population[neighbour] = 2
append!(exposed, neighbour)
filter!(i -> i != neighbour, susceptible)
infection_days[neighbour] = t
# If neighbour is recovered
elseif population[neighbour] == 4
time_from_recovery = t - recovery_days[neighbour]
full_immunity_time = floor(0.3 * immunity_time)
inf_prob = inf_prob * (time_from_recovery - full_immunity_time) / (immunity_time - full_immunity_time)
if time_from_recovery >= full_immunity_time && rand()<inf_prob
population[neighbour] = 2
append!(exposed, neighbour)
filter!(i -> i != neighbour, recovered)
infection_days[neighbour] = t
end
end
end
end
end
# Infected person can recover
if rand()<recovery_prob
population[index] = 4
append!(recovered, index)
filter!(i -> i != index, infected)
filter!(i -> i != index, infected_asymptomatic)
recovery_days[index] = t
# If infected person has symptoms he can die
elseif index â infected && rand()<death_prob
population[index] = 0
append!(dead, index)
filter!(i -> i != index, infected)
end
# If person looses immunity
elseif population[index] == 4 && t - recovery_days[index] >= immunity_time
population[index] = 1
append!(susceptible, index)
filter!(i -> i != index, recovered)
end
end
end
total_infected_number = length(infected) + length(infected_asymptomatic)
deaths = length(dead)
append!(total_infected_record, total_infected_number)
append!(infected_record, length(infected))
append!(dead_record, deaths)
if display_heatmap
heatmap(population,
title="Day: $t Deaths: $deaths",
color=[:black, :lemonchiffon, :orange, :orange, :green4],
clim=(0, 4),
size=(650, 650),
aspectratio=1
)
end
end
deaths = length(dead)
max_symptoms_infected = maximum(infected_record)
if display_plot
plot(0:T, total_infected_record, title="Deaths: $deaths", legend=false)
plot!(0:T, dead_record)
plot!(0:T, infected_record) |> display
end
if display_heatmap
gif(anim, "epidemic.gif", fps=15) |> display
end
return [deaths, max_symptoms_infected]
end
area_epidemic_simulation
size = 100 # Population - 10 000
N0 = 10
incubation_time = 5
immunity_time = 240
vaccine_immunity_time = 180
death_prob = 0.002
recovery_prob = 0.04
symptoms_prob = 0.5
0.5
# Standard parameters, no vaccination
meetings = 3
lockdowns = []
vaccination_day = 700
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 600
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\epidemic.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
2-element Vector{Int64}:
561
957
# Standard parameters and vaccination
meetings = 3
lockdowns = []
vaccination_day = 300
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 600
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\epidemic.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
2-element Vector{Int64}:
454
822
# No vaccination, increased meetings number and moving probability
meetings = 5
lockdowns = []
vaccination_day = 600
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.006
T = 600
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\epidemic.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
2-element Vector{Int64}:
743
1461
meetings = 3
lockdowns = []
vaccination_day = 400
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 300
display_heatmap = false
display_plot = false
counter = 1
travels = []
deaths = []
max_infected = []
# Run three simulations for each moving probability in range from 0.01 to 0.001
for move_prob in 0.01:-0.001:0.001
average_travels = Int(round(move_prob * size^2, digits=0))
deaths_results = []
max_infected_results = []
# Run three simulations and calculate the average values
for simulation in 1:3
result = area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_prob, T,
display_heatmap, display_plot)
append!(deaths_results, result[1])
append!(max_infected_results, result[2])
print(" $counter > ") # Progress bar
counter += 1
end
average_deaths = deaths_results |> mean |> floor |> Int
average_max_infected = max_infected_results |> mean |> floor |> Int
append!(travels, average_travels)
append!(deaths, average_deaths)
append!(max_infected, average_max_infected)
end
data = DataFrame(travels=travels,
deaths=deaths,
max_infected=max_infected)
CSV.write("travels.csv", data)
CSV.read("travels.csv", DataFrame)
| travels | deaths | max_infected | |
|---|---|---|---|
| Int64 | Int64 | Int64 | |
| 1 | 100 | 333 | 1459 |
| 2 | 90 | 314 | 1462 |
| 3 | 80 | 307 | 1349 |
| 4 | 70 | 321 | 1320 |
| 5 | 60 | 316 | 1239 |
| 6 | 50 | 302 | 1158 |
| 7 | 40 | 301 | 1130 |
| 8 | 30 | 285 | 1015 |
| 9 | 20 | 273 | 888 |
| 10 | 10 | 259 | 815 |
CSV.read("infection_prob.csv", DataFrame)
| infection_probability | deaths | max_infected | |
|---|---|---|---|
| Float64 | Int64 | Int64 | |
| 1 | 0.8 | 144 | 467 |
| 2 | 0.7 | 130 | 406 |
| 3 | 0.6 | 124 | 376 |
| 4 | 0.5 | 122 | 324 |
| 5 | 0.4 | 98 | 256 |
| 6 | 0.3 | 73 | 172 |
| 7 | 0.2 | 32 | 94 |
CSV.read("meetings.csv", DataFrame)
| meetings | deaths | max_infected | |
|---|---|---|---|
| Int64 | Int64 | Int64 | |
| 1 | 4 | 325 | 1029 |
| 2 | 3 | 287 | 863 |
| 3 | 2 | 239 | 696 |
| 4 | 1 | 168 | 526 |
CSV.read("vaccinations.csv", DataFrame)
| vaccinated | deaths | max_infected | |
|---|---|---|---|
| Int64 | Int64 | Int64 | |
| 1 | 100 | 186 | 840 |
| 2 | 90 | 202 | 835 |
| 3 | 80 | 170 | 718 |
| 4 | 70 | 194 | 722 |
| 5 | 60 | 208 | 819 |
| 6 | 50 | 216 | 848 |
| 7 | 40 | 227 | 846 |
| 8 | 30 | 246 | 826 |
| 9 | 20 | 267 | 917 |
| 10 | 10 | 274 | 870 |
# Standard parameters, no vaccination, no lockdowns
meetings = 3
lockdowns = []
vaccination_day = 700
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 400
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\epidemic.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
2-element Vector{Int64}:
368
936
# Standard parameters, no vaccination, light lockdown from 70 to 200
meetings = 3
lockdowns = [[70, 200, 1]]
vaccination_day = 700
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 400
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T)
â Info: Saved animation to â fn = C:\Users\szymo\Jupyter Projects\epidemic.gif â @ Plots C:\Users\szymo\.julia\packages\Plots\z5Msu\src\animation.jl:104
2-element Vector{Int64}:
348
562
W tym przypadku lockdown bÄdzie trwaĆ krĂłcej, poniewaĆŒ czas trwania lockdownu jest ograniczony. SzczegĂłlnie, jeĆli mĂłwimy o ciÄĆŒkim lockdownie.
Na wykresie widzimy, ĆŒe pierwsza fala trwa okoĆo czterech miesiÄcy. ZaĆĂłĆŒmy, ĆŒe moĆŒemy wprowadziÄ ciÄĆŒki lockdown, ale tylko na dwa miesiÄ ce. Wtedy pojawia siÄ pytanie, kiedy to zrobiÄ?
# Standard parameters, no vaccination, heavy lockdown from 70 to 130
meetings = 3
lockdowns = [[70, 130, 2]]
vaccination_day = 700
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 400
display_heatmap = false
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T, display_heatmap)
2-element Vector{Int64}:
315
742
# Standard parameters, no vaccination, heavy lockdown from 100 to 160
meetings = 3
lockdowns = [[100, 160, 2]]
vaccination_day = 700
vaccinations = 0.004
infection_probability = 0.8
move_probability = 0.002
T = 400
display_heatmap = false
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T, display_heatmap)
2-element Vector{Int64}:
400
747
# Standard parameters, vaccination, heavy lockdown from 10 to 100, light lockdown from 180 to 420
meetings = 3
lockdowns = [[10, 100, 2], [180, 420, 1]]
vaccination_day = 300
vaccinations = 0.003
infection_probability = 0.8
move_probability = 0.002
T = 600 # Today is 430
display_heatmap = false
area_epidemic_simulation(size, N0, meetings, incubation_time, immunity_time, lockdowns,
vaccination_day, vaccinations, vaccine_immunity_time,
death_prob, recovery_prob, infection_probability, symptoms_prob, move_probability, T, display_heatmap)
2-element Vector{Int64}:
340
609